# *******************************************************************************
# Copyright (c) 2015 fortiss GmbH This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0 which
# is available at http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors: Gerd Kainz, Alois Zoitl - initial API and implementation
# and/or initial documentation
# *******************************************************************************/

if (NOT FORTE_ARCHITECTURE STREQUAL "Posix")
    return()
endif ()

option(FORTE_MODULE_Raspberry_SPS "Interacting with GPIOs Raspberry SPS" OFF)

if (NOT FORTE_MODULE_Raspberry_SPS)
    return()
endif ()

# ############################################################################
# i2c-dev
# ############################################################################

forte_set_process_interface("Raspberry-SPS" IX QX IW QW)
add_library(forte-raspberry_sps
            ../i2c_dev/i2cprocessinterface.h
            ../i2c_dev/i2cprocessinterface.cpp processinterface.h
            processinterface.cpp
)
target_link_libraries(forte-raspberry_sps PUBLIC forte-core)
target_link_libraries(forte PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,forte-raspberry_sps,$<LINK_LIBRARY:WHOLE_ARCHIVE,forte-raspberry_sps>>)
install(TARGETS forte-raspberry_sps EXPORT forte-export FILE_SET HEADERS)
